package com.erb.service.llb.impl;

import com.erb.entity.*;
import com.erb.mapper.OtherMapper;
import com.erb.service.llb.IOtherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class OtherServiceImpl implements IOtherService {

	@Autowired
	OtherMapper otherMapper;

	@Override
	public int updateUserBalance(int id, Double balance) {
		return otherMapper.updateUserBalance(id, balance);
	}

	@Override
	public int addCapitalLog(CapitalLog capitalLog) {
		return otherMapper.addCapitalLog(capitalLog);
	}

	@Override
	public int updateProductHaveMoney(int id, Double haveMoney) {
		return otherMapper.updateProductHaveMoney(id, haveMoney);
	}

	@Override
	public int updateProductStatus(int pid, int status) {
		return otherMapper.updateProductStatus(pid, status);
	}


	@Override
	public List<Invest> findInvestByPro(Pager pager, int pid) {
		return otherMapper.findInvestByPro((pager.getCurrPage() - 1) * pager.getPageSize(), pager.getPageSize(), pid);
	}

	@Override
	public int findTotalInvestByPro(int pid) {
		return otherMapper.findTotalInvestByPro(pid);
	}

	@Override
	public int findPayPassByUid(int uid) {
		return otherMapper.findPayPassByUid(uid);
	}

	@Override
	public User findUserById(int id) {
		return otherMapper.findUserById(id);
	}

	@Override
	public int countInvest(int uid) {
		return otherMapper.countInvest(uid);
	}

	@Override
	public List<UserCount> topFiveInvest() {
		return otherMapper.topFiveInvest();
	}

	@Override
	public List<UserCount> topFiveProfit() {
		return otherMapper.topFiveProfit();
	}

	@Override
	public Redpacketrecord findRedById(int rid) {
		return otherMapper.findRedById(rid);
	}

	@Override
	public List<Redpacketrecord> findRedByUser(int uid, Integer rtype, Integer ptype, Integer state) {
		return otherMapper.findRedByUser(uid, rtype, ptype, state);
	}

	@Override
	public int updateRedState(int id, int state, String exchangeTime) {
		return otherMapper.updateRedState(id, state, exchangeTime);
	}

	@Override
	public Double sumProfit() {
		return otherMapper.sumProfit();
	}

	@Override
	public Integer todayExchange(int uid, int gid) {
		return otherMapper.todayExchange(uid, gid);
	}

	@Override
	public int addRecord(IntegralGoodsRecord record) {
		return otherMapper.addRecord(record);
	}

	@Override
	public int addRedPacket(Redpacketrecord redpacketrecord) {
		return otherMapper.addRedPacket(redpacketrecord);
	}

	@Override
	public Integer userIntegral(int uid) {
		return otherMapper.userIntegral(uid);
	}
}
